<!DOCTYPE html>
<html>
<head>
	
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title>蹭一族</title>
	<!-- Bootstrap 3.3.5 -->
  <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css"  />
  <!-- Font Awesome -->
  <link rel="stylesheet" href="/static/awesome/css/font-awesome.min.css" /> 
  <!-- Ionicons -->
  <link rel="stylesheet" href="/static/ionicon/css/ionicons.min.css" />
  <!-- Theme style -->
  <link rel="stylesheet" href="/static/dist/css/AdminLTE.min.css" />
  <!-- AdminLTE Skins. Choose a skin from the css/skins
       folder instead of downloading all of them to reduce the load. -->
  <link rel="stylesheet" href="/static/dist/css/skins/_all-skins.min.css" />
   <link rel="stylesheet" href="/static/js/img/img.css" />
   
 <!-- 引入uploadify -->
<link href="/static/js/uploadify/uploadify.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="/static/js/img/img.css" type="text/css">
<!-- ./wrapper -->	

<link href="/static/bootstrapValidate/css/bootstrapValidator.min.css" rel="stylesheet" />

 <!-- DataTables -->
  <link rel="stylesheet" href="/static/plugins/datatables/dataTables.bootstrap.css">
   <!-- DataTables -->
  <link rel="stylesheet" href="https://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css">


</head>
<body class="hold-transition skin-blue sidebar-mini">
	 	<div class="box box-danger">
             <#-- 内容 -->
		    <section class="content"  >
		       <table>
		       		<tr>
		       			
		       			<#--
		       				<td>
		       				<a class="btn btn-app" onclick="addFun()" >
			                	<i class="fa fa-plus"></i> 添加
			              	</a>
		       			</td>
		       			<td>
		       				<a class="btn btn-app" onclick="editFun()" >
			                	<i class="fa fa-edit"></i> 修改
			              	</a>
		       			</td>
		       				<td>
		       				<a class="btn btn-app" onclick="delFun()"  >
			                	<i class="fa fa-minus"></i> 删除
			              	</a>
		       			</td>
		       			 -->
		       		</tr>
		       </table>
		    
		       <table id="datatable" class="table table-bordered table-striped">
		                <thead>
			                <tr >
			                   <th>商品名称</th>
			                  <th>图片</th>
			                  <th>价格</th>
			                  <th>数量</th>
			                  <th>类型</th>
			                  <th>创建时间</th>
			                </tr>
		                </thead>
		        </table>
		      
		    </section>
             
            
       </div>
<!-- jQuery 2.1.4 -->
<script src="/static/plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="/static/js/jqueryUi.min.1.11.4.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<!-- Bootstrap 3.3.5 -->
<script src="/static/bootstrap/js/bootstrap.min.js"></script>
<!-- Morris.js charts 
<script src="/static/plugins/morris/morris.min.js"></script>
-->
<!-- Slimscroll -->
<script src="/static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="/static/plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="/static/dist/js/app.min.js"></script>

<!-- layer-->
<script src="/static/layer/layer.js"></script>

<!-- layer-->
<script src="/static/js/syUI.js"></script>



<script type="text/javascript" src="/static/js/uploadify/swfobject.js"></script>
<script type="text/javascript" src="/static/js/uploadify/jquery.uploadify.js"></script>
<!-- 引入ui扩展 -->
<script src="/static/js/core.ui.js" type="text/javascript" charset="utf-8"></script>
<!-- 引入图片裁剪-->
<link rel="stylesheet" href="/static/js/tapmodo-Jcrop-1902fbc/css/jquery.Jcrop.css" type="text/css">
<script type="text/javascript" src="/static/js/tapmodo-Jcrop-1902fbc/js/jquery.Jcrop.js"></script>
<script type="text/javascript" src="/static/js/tapmodo-Jcrop-1902fbc/js/jquery.Jcrop.min.js"></script>
<!-- 浏览大图 -->
<script type="text/javascript" src="/static/js/img/img.js"></script>

<script type="text/javascript" src="/static/js/ut.js" ></script>

<!-- 引入kindeditor控件 -->
<script src="/static/js/kindeditor-4.1.10/kindeditor-all.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/bootstrapValidate/js/bootstrapValidator.min.js"></script>

<!-- InputMask -->
<script src="/static/plugins/input-mask/jquery.inputmask.js"></script>
<script src="/static/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="/static/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<!-- DataTables -->
<script src="/static/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="/static/plugins/datatables/dataTables.bootstrap.min.js"></script>



<script>
	var table ;
	var id ="${id}";
	$(function(){
		table = $("#datatable").dataTable({
	      "processing": true,
	      "serverSide": true,
	       ordering:false,
	       searching:false,
	       bLengthChange:false,
	       "ajax" : "/order/goodsList?id="+id,
	       "oLanguage" : {
                "sLengthMenu": "每页显示 _MENU_ 条记录",
                "sZeroRecords": "抱歉， 没有找到",
                "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty": "没有数据",
                "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                "sZeroRecords": "没有检索到数据",
                "sSearch": "商家名称:",
                "oPaginate": {
                "sFirst": "首页",
                "sPrevious": "前一页",
                "sNext": "后一页",
                "sLast": "尾页"
                }
                     
            },
            "aoColumnDefs": [
			{
			 sDefaultContent: '',
			 aTargets: [ '_all' ]
			  }
			],
	      <!-- "fnServerData":retrieveData, //与后台交互获取数据的处理函数   
	         -->
	      "columns": [
	       <!-- {"data": "id",sWidth:'3%'},, "bSortable": false -->
	        {"data": "goodsName",sWidth:'10%'},
	        {
	        	"data": "goodsImg",sWidth:'10%',
	        	"render": function(data, type, full) {
	        		if(data.indexOf('http')==-1){
	        			return po.showImg(data,20,20);
	        		}
		            return "<img src='" + data + "' width='20px' height='20px' ></img>";
		          }
	        },
	        {
	        	"data": "price",sWidth:'10%'
	        },
	        {
	        	"data": "num",sWidth:'10%'
	        },
	        {
	        	"data": "goodsType",sWidth:'10%',
	        	"render": function(data, type, full) {
	        		if(data==1){
	        			return "菜品";
	        		}else if(data==2){
	        			return "团购";
	        		}
		            return "酒水";
		          }
	        },
	        {"data": "createTime",sWidth:'15%'},
	      ]
	    });
	    
	    $("#datatable tbody").click(function (event) {
            $(table.fnSettings().aoData).each(function () {
                $(this.nTr).removeClass('selected');
            });
            $(event.target.parentNode).addClass('selected');
            
        });

        $('#datatable tbody tr').click(function (event) {
            var aData = table.fnGetData(this); // get datarow
            if (null != aData)  // null if we clicked on title row
            {
                var tt = aData[0];
                alert(tt);
               document.getElementById("Hidden1").value = tt;
            }
        });
	});
	
	 
	 
</script>

</body>
</html>
